package priv.tuyou.redis.simple;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class JedisPoolUtil {

	static JedisPool pool;

	public static JedisPool getPool() {
		if (pool == null) {
			pool = new JedisPool("localhost", 6379);
		}
		return pool;
	}

	public static void main(String[] args) {
		Jedis jedis = getPool().getResource();
		jedis.setnx("name", "tuyou");
		jedis.close();
		pool.close();
	}
}
